#ifndef CACHE_INDEX_H
#define CACHE_INDEX_H
#include "string.h"
#include "cache_file.h"

enum cache_op {
	CACHE_INDEX_NONE,
	CACHE_INDEX_ADD,
	CACHE_INDEX_DEL,
};

typedef struct {
	unsigned char key[16];
	int header_size;
	int body_size;
	cache_time_t time;
	int operate; /* 0: ADD 1: EDIT 2: DELETE */
}cache_index_t;

typedef struct {
	int version;
	int record_size;
}cache_index_hdr_t;

extern int cache_index_add(cache_file_t *cache, int operate);
extern void cache_index_init(void);
#endif
